library(WebGestaltR)

####### ORA example #########
geneFile <- system.file("extdata", "interestingGenes.txt", package="WebGestaltR")
refFile <- system.file("extdata", "referenceGenes.txt", package="WebGestaltR")
outputDirectory <- getwd()
enrichResult <- WebGestaltR(enrichMethod="ORA", organism="hsapiens",
                            enrichDatabase="pathway_KEGG", interestGeneFile=geneFile,
                            interestGeneType="genesymbol", referenceGeneFile=refFile,
                            referenceGeneType="genesymbol", isOutput=TRUE)

####### GSEA example #########
rankFile <- system.file("extdata", "GeneRankList.rnk", package="WebGestaltR")
outputDirectory <- getwd()
enrichResult <- WebGestaltR(enrichMethod="GSEA", organism="hsapiens",
                            enrichDatabase="pathway_KEGG", interestGeneFile=rankFile,
                            interestGeneType="genesymbol", sigMethod="top", topThr=10, minNum=5)

####### NTA example #########
enrichResult <- WebGestaltR(enrichMethod="NTA", organism="hsapiens",
                            enrichDatabase="network_PPI_BIOGRID", interestGeneFile=geneFile,
                            interestGeneType="genesymbol", sigMethod="top", topThr=10,
                            outputDirectory=getwd(), highlightSeedNum=10,
                            networkConstructionMethod="Network_Retrieval_Prioritization")